home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Menus & More Installation Script for use with ARexx */ /* */ /* $VER: Install.rexx 3.21 (13.03.96) by Axel Sodtalbers */ /* */ /* PURPOSE: M&M installation routine; */ /* to be called from 'Install.M&M' project */ /* */ /* 3.00 (11.02.95) first release */ /* 3.10 (19.02.95) now correct directory name */ /* 3.20 (11.06.95) correct assign statement in user-startup */ /* Don't forget hint at the end */ /* */ /* 3.21 (13.03.96) | instead of || */ /* no more writing to S:user-startup */ /* */ /* oh dear, what a strange language... */ /* */ /* Das deutsche ARexx Handbuch ist wirklich */ /* DAS MIT ABSTAND MIESESTE EDV HANDBUCH */ /* das ich JEMALS gelesen habe - wirklich unglaublich... */ /*** Init ***/ OPTIONS RESULTS OPTIONS FAILAT 21 IF SHOW('P', 'MMPlayer') THEN ADDRESS "MMPlayer" 'AlohaPlayer' 'Query ISGERMAN' ger = RESULT oldstatus = '' lhaprg = "C:lha" /*** fetch target directory ***/ if ger then do "Req 'Gleich erscheint ein Verzeichnis-Requester.||Bitte geben Sie dort an, in welchem||Verzeichnis das Unterverzeichnis M&M||für Menus&More angelegt werden soll!||(Die M&M-Dateien belegen ca. 1 MB)' 'Okay, klar zum Abheben!|Abbruch'" if RESULT~=0 then do RESULT=0 /* ?!? */ "ReqDir 'M&M installieren nach:' 'RAM:'" if RESULT>0 then target=RESULT else exit end else exit end else do "Req 'After this, a directory-requester will appear.||Please select, in which drawer||the sub-directory M&M shall be created!||(M&M needs about 930 KB of free disk space)' 'Okay, ready for take off!|Cancel'" if RESULT~=0 then do RESULT=0 "ReqDir 'Install M&M to:' 'RAM:'" if RESULT>0 then target=RESULT else exit end else exit end 'FileExists' target if RESULT=0 then do if ger then do "Req" "'Das angebene Verzeichnis||" || target || "||existiert nicht!||'" "'Verzeichnis erstellen|Abbrechen'" end else do "Req" "'The given drawer||" || target || "||does not exist!||'" "'Create the drawer|Cancel'" end if RESULT=1 then do ADDRESS COMMAND MakeDir "> nil:" target ADDRESS COMMAND "Copy MM:/M&M3.21.info to "||target||".info QUIET" end else do exit end end /*** check for M&M sub-directory ***/ MakeNewDir = 1 if (right(target, 1) ~= ':') then target = target || '/M&M' else target=target || 'M&M' 'FileExists' target if RESULT~=0 then do if ger then "Req" "'Hier existiert schon||ein M&M Unterverzeichnis!'" "'Alte Dateien überschreiben|Abbrechen'" else "Req" "'There is already||a M&M sub-directory!'" "'Overwrite old files|Cancel'" if RESULT=0 then exit else MakeNewDir = 0 end /*** build drawing area ***/ x=30 y=150 i=x+650 k=y+70 'DrawColor 0' 'DrawRectFill' x y i k 'DrawColor 1' if ger then 'DrawText 300, 162, "Erledigt:"' else 'DrawText 300, 162, "Progress:"' 'DrawText 150, 195, "0%"' 'DrawText 520, 195, "100%"' call DrawShadow x=150 y=170 i=560 k=y+15 if MakeNewDir=1 then do if ger then Call StatusOut ("'Zielverzeichnis " || target || " erstellen...'") else Call StatusOut ("'Creating target directory " || target || "...'") ADDRESS COMMAND Makedir "> nil:" target ADDRESS COMMAND "Copy MM:/M&M3.21.info to "||target||".info QUIET" end Call Complete (5) /*** copy and extract files ***/ copyDone=0 Call CopyFile('MMEditor') if ~copyDone then exit Call CopyFile('MMEditor.info') if copyDone then Call Complete (20) else exit Call CopyFile('MMPlayer') if ~copyDone then exit Call CopyFile('MMPlayer.info') if copyDone then Call Complete (30) else exit Call CopyFile('M&M.guide') if ~copyDone then exit Call CopyFile('M&M.guide.info') if copyDone then Call Complete (40) else exit Call CopyFile('Tools') if ~copyDone then exit Call CopyFile('Tools.info') if copyDone then Call Complete (50) else exit Call CopyFile('Examples') if ~copyDone then exit Call CopyFile('Examples.info') if copyDone then Call Complete (70) else exit Call CopyFile('ARexx') if ~copyDone then exit Call CopyFile('ARexx.info') if copyDone then Call Complete (75) else exit Call CopyFile('M&M.config.info') if ~copyDone then exit Call CopyFile('M&M.icon.info') if ~copyDone then exit Call CopyFile('M&M.appicon.info') if copyDone then Call Complete (77) else exit Call CopyFile('ReadMe.guide') if ~copyDone then exit Call CopyFile('ReadMe.guide.info') if copyDone then Call Complete (80) else exit /*** german files ***/ if ger then do Call StatusOut ('"Deutschsprachige Kataloge kopieren..."') 'FileExists LOCALE:catalogs/deutsch' if RESULT=0 then 'Req "Installation der deutsche Kataloge z.Zt. NICHT möglich!||Bitte nachholen - sonst keine deutsche Oberfläche!" "Jawoll, wird erledigt!"' else do ADDRESS COMMAND "Copy MM:deutsch/MMEditor.catalog to LOCALE:Catalogs/deutsch QUIET" ADDRESS COMMAND "Copy MM:deutsch/MMPlayer.catalog to LOCALE:Catalogs/deutsch QUIET" end Call Complete (82) Call StatusOut ('"Deutschsprachige Dokumentation kopieren..."') 'Req "Soll AUCH die englische Dokumentation||kopiert werden?" "Jawohl!|Nein"' if RESULT=0 then do ADDRESS COMMAND Copy 'MM:M&MD.guide' to target||'/M&M.guide' ADDRESS COMMAND Copy 'MM:M&MD.guide.info' to target||'/M&M.guide.info' end else do Call CopyFile('M&MD.guide') if copyDone then do Call CopyFile('M&MD.guide.info') ADDRESS COMMAND Rename target||'/M&M.guide' to target||'/M&ME.guide' ADDRESS COMMAND Rename target||'/M&M.guide.info' to target||'/M&ME.guide.info' ADDRESS COMMAND Rename target||'/M&MD.guide' to target||'/M&M.guide' ADDRESS COMMAND Rename target||'/M&MD.guide.info' to target||'/M&M.guide.info' end else exit end Call Complete (90) end /*** old icons? ***/ if ger then 'Req "Möchten Sie die normalen 4-farbigen oder||die 8-farbigen MagicWB Piktogramme benutzen?" "MagicWB|Normale"' else 'Req "Do you want to use the normal (4 colours) or||the MagicWB (8 colours) icons?" "MagicWB|Normal"' if RESULT=0 then do ADDRESS COMMAND Copy 'MM:OldIcons/#?.info' to target ALL QUIET ADDRESS COMMAND Copy 'MM:OldIcons/Examples/#?.info' to target||'/Examples/' ALL QUIET ADDRESS COMMAND Copy 'MM:OldIcons/Tools/#?.info' to target||'/Tools/' ALL QUIET ADDRESS COMMAND Copy 'MM:OldIcons/Examples.info' to target||'.info' ALL QUIET end Call Complete (94) /*** this project ***/ ADDRESS COMMAND Copy 'MM:Install.M&M' to target||'/Examples/' QUIET /*** Copying libraries ***/ Call CopyLib ('ASL.library') Call Complete (95) Call CopyLib ('diskfont.library') Call Complete (96) Call CopyLib ('rexxsyslib.library') Call Complete (97) Call CopyLib ('AmigaGuide.library') Call Complete (98) Call CopyLib ('Locale.library') /*** done! ***/ Call Complete (100) if ger then 'Req "Okay, die Installation wurde||erfolgreich beendet!" "Na super!"' else 'Req "Okay, Installation has been||finished successfully!" "Well done!"' 'LoadBrush "MM:Examples/Install_DontForget.pic"' 'PasteBrush 54, 153' 'FreeBrush' Call StatusOut ('""') 'AlohaPlayer' ADDRESS COMMAND "Assign MM: REMOVE" exit /************************/ /* */ /* Subroutine: FileCopy */ /* */ /************************/ CopyFile: parse arg file newtarget = target||"/"||file if ger then Call StatusOut ("'Kopiere "||file||" nach "||newtarget||"...'") else Call StatusOut ("'Copy "||file||" to "||newtarget||"...'") copyDone=1 do forever ADDRESS COMMAND Copy ">NIL:" file newtarget "ALL QUIET" if RC > 0 then do if ger then 'Req "Kopieren ist fehlgeschlagen!" "Nochmal versuchen|Ignorieren|Abbrechen"' else 'Req "Copy failed!" "Try again|Ignore|Cancel"' r=RESULT if r=0 then do /* cancel */ copyDone=0 leave end if r=2 then /* ignore */ leave end else leave end return /*************************************/ /* */ /* Subroutine: ExtractFiles - future */ /* */ /*************************************/ ExtractFiles: parse arg archive targetdir . do forever 'FileExists' lhaprg if RESULT=0 then do if ger then 'Req "Kann das Programm LhA nicht finden!" "LhA suchen|Abbrechen"' else 'Req "Cannot find the LhA program!" "Search for it|Cancel"' r=RESULT if r=0 then do /* cancel */ extractDone=0 leave end else do 'ReqFile "LhA ???" "'||lhaprg||"'" if RESULT>0 then lhaprg=RESULT end end else leave end newtarget = target||"/"||targetdir||"/" if ger then Call StatusOut ("'Extrahiere "||archive||" nach "||newtarget||"...'") else Call StatusOut ("'Extracting "||archive||" to "||newtarget||"...'") extractDone=1 do forever ADDRESS COMMAND lhaprg "-q x" archive newtarget if RC > 0 then do if ger then 'Req "Extrahieren des Archivs ist fehlgeschlagen!" "Nochmal versuchen|Ignorieren|Abbrechen"' else 'Req "Extracting from Archive failed!" "Try again|Ignore|Cancel"' r=RESULT if r=0 then do /* cancel */ extractDone=0 leave end if r=2 then /* ignore */ leave end else leave end return /****************************/ /* */ /* Subroutine: Library Copy */ /* */ /****************************/ CopyLib: parse arg lib if ger then Call StatusOut ("'Teste "||lib||"...'") else Call StatusOut ("'Checking "||lib||"...'") 'FileExists' 'LIBS:'||lib if RESULT=0 then do if ger then "Req" "'Die Library||"||lib||"||existiert nicht! Bitte original Workbench-Disk||in Laufwerk DF0: einlegen!'" "'Weiter|Ignorieren'" else "Req" "'The"||lib|| "||does not exist!||Please insert original Workbench-Disk into DF0:!'" "'Go on|Ignore'" do while (RESULT~=0) if ger then Call StatusOut ("'Kopiere DF0:Libs/"||lib||" nach LIBS: ...'") else Call StatusOut ("'Copy DF0:Libs/"||lib||" to LIBS: ...'") ADDRESS COMMAND "Copy DF0:Libs/"||lib||" to LIBS: QUIET" if RC>0 then do if ger then "Req" "'Kopieren ist fehlgeschlagen!||'" "'Nochmal versuchen|Ignorieren'" else "Req" "'Copy failed!||'" "'Try again|Ignore'" end end end return StatusOut: /* what is done currently */ procedure expose oldstatus parse arg status 'DrawColor 0' 'DrawText 50, 210,' oldstatus oldstatus = status 'DrawColor 6' 'DrawText 50, 210,' status return Complete: /* completage display */ parse arg percentage 'DrawColor 1' oldi = i; i = x + ((i-x)%100*percentage) 'DrawRectFill' x y i k call DrawShadow i=oldi return DrawShadow: /* paint a shadow effect */ 'DrawColor 2' /* white */ 'DrawLine' x k x y 'DrawLine' x+1 k x+1 y+1 'DrawLine' x y i y 'DrawColor 3' /* black */ 'DrawLine' i y i k 'DrawLine' i-1 y+1 i-1 k 'DrawLine' i k x+1 k return